package com.hongmeng.teamwork.enums;

public enum TaskStatusEnum {
    UN_START(0, "未开始"),
    DOING(1, "进行中"),
    FINISHED(2, "已完成"),
    ;

    private int code;
    private String desc;

    TaskStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static TaskStatusEnum ofEnum(int code) {
        for (TaskStatusEnum taskStatusEnum : TaskStatusEnum.values()) {
            if (taskStatusEnum.code == code) {
                return taskStatusEnum;
            }
        }
        return null;
    }
}
